// #include "LinkTree.h"
#include "MyFileSystem.h"
#include <iostream>

// int main()
// {
// LinkTree tree;
// TreeNode *one = new TreeNode(1);
// TreeNode *two = new TreeNode(2);
// TreeNode *three = new TreeNode(3);

// one->Connect(tree.GetRoot());
// two->Connect(one);
// three->Connect(one);

// TreeNode *four = new TreeNode(4);
// TreeNode *five = new TreeNode(5);
// TreeNode *six = new TreeNode(6);
// TreeNode *seven = new TreeNode(7);
// TreeNode *eight = new TreeNode(8);
// TreeNode *nine = new TreeNode(9);

// four->Connect(two);
// five->Connect(two);
// six->Connect(two);

// seven->Connect(three);
// eight->Connect(three);
// nine->Connect(three);

// nine->Disconnect(three);
// nine->Connect(two);
// tree.show();

// DoubleLinkList list = tree.FindByElement(6);
// TreeNode *n = (TreeNode*)*list.FindByIndex(0);
// n->Disconnect(n->Getparent());

// list = tree.FindByElement(4);
// TreeNode *p = (TreeNode*)*list.FindByIndex(0);
// n->Connect(p);

// tree.show();

// std::cout<<tree.GetTreeHeight()<<std::endl;
// std::cout<<tree.Size()<<std::endl;
// std::cout<<tree.leaves()<<std::endl;

// LinkTree tree;
// TreeNode *suqian = new TreeNode("苏嵌");
// suqian->Connect(tree.GetRoot());
// TreeNode *class1 = new TreeNode("267班");
// TreeNode *class2 = new TreeNode("268班");
// class1->Connect(suqian);
// class2->Connect(suqian);

// TreeNode *c1 = new TreeNode("张三");
// TreeNode *c2 = new TreeNode("李四");
// TreeNode *c3 = new TreeNode("王五");
// TreeNode *c4 = new TreeNode("赵六");
// c1->Connect(class1);
// c2->Connect(class1);

// c3->Connect(class2);
// c4->Connect(class2);

// tree.show();

// DoubleLinkList list = tree.FindByElement("李四");
// TreeNode *stu = (TreeNode *)*list.FindByIndex(0);
// stu->Disconnect(stu->Getparent());

// list = tree.FindByElement("268班");
// TreeNode *c = (TreeNode *)*list.FindByIndex(0);
// stu->Connect(c);

// tree.show();

//     MyFileSystem s("/home/lvguanzhong/95/数据结构");
//     s.show();

//     return 0;
// }

int main(int argc, char *argv[])
{
    std::string path("./");
    if(argc >= 2)
    {
        path = argv[1];
    }
    MyFileSystem s("/home/lvguanzhong/95/数据结构/树/通用树");
    // s.show();
    s.FindByFileName("main.cpp");
    // s.show();

    return 0;
}
